const { name } = require('./package')
const port = 8080
const dev = process.env.NODE_ENV === 'development'
console.log(dev)
module.exports = {
  // 配置publicPath，填写你本机的ip地址
  publicPath: dev ? `/` : process.env.BASE_URL,
  devServer: {
    port, // 端口号
    host: '0.0.0.0',
    headers: {
      'Access-Control-Allow-Origin': '*',
    },
  },
  configureWebpack: {
    output: {
      library: `${name}-[name]`,
      libraryTarget: 'umd', // 把微应用打包成 umd 库格式
      jsonpFunction: `webpackJsonp_${name}`,
    },
  },
};